﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Skala.master" AutoEventWireup="true" CodeFile="KrediKart.aspx.cs" Inherits="KrediKart" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script type="text/javascript">
        
        function alertSiparis(SiparisId) {
            alertOzel(SiparisId);
        }
        
        $(document).ready(function () {

            var dil = getCookie('dil');
            var butonValue;
            if (dil == 'TR') butonValue = 'ÖDEME YAP';
            else butonValue = 'PAY';
            $("#odemeYap").text(butonValue);

        $("#odemeYap").click(function () {            
            var success = true;
            var odemesekli = $('#' + '<%= ddlOdemeSekli.ClientID  %>').val();
            
            if (!kontrolEt('#' + '<%= ddlOdemeSekli.ClientID  %>', '-1')) success = false;
            if (!kontrolEt('#' + '<%= ddlKartTipi.ClientID  %>', '-1')) success = false;
            if (!kontrolEt('#' + '<%= txtKartNo.ClientID  %>', '')) success = false;
            if (!kontrolEt('#' + '<%= txtKartSahibi.ClientID  %>', '')) success = false;
            if (!kontrolEt('#' + '<%= aylar.ClientID  %>', '-1')) success = false;
            if (!kontrolEt('#' + '<%= yillar.ClientID  %>', '-1')) success = false;
            if (!kontrolEt('#' + '<%= txtCvv.ClientID  %>', '')) success = false;
            
            if (success) {                
                $('#' + '<%= btnKaydet.ClientID  %>').trigger("click");              
            }
        });
    });

    $(document).ready(function () {
    var kredikarti = Sys.WebForms.PageRequestManager.getInstance();       


    kredikarti.add_endRequest(function () {

        var dil = getCookie('dil');
        var butonValue;
        if (dil == 'TR') butonValue = 'ÖDEME YAP';
        else butonValue = 'PAY';
        $("#odemeYap").text (butonValue);

            $("#odemeYap").click(function () {            
                var success = true;
                var odemesekli = $('#' + '<%= ddlOdemeSekli.ClientID  %>').val();

                if (!kontrolEt('#' + '<%= ddlOdemeSekli.ClientID  %>', '-1')) success = false;
                if (!kontrolEt('#' + '<%= ddlKartTipi.ClientID  %>', '-1')) success = false;
                if (!kontrolEt('#' + '<%= txtKartNo.ClientID  %>', '')) success = false;
                if (!kontrolEt('#' + '<%= txtKartSahibi.ClientID  %>', '')) success = false;
                if (!kontrolEt('#' + '<%= aylar.ClientID  %>', '-1')) success = false;
                if (!kontrolEt('#' + '<%= yillar.ClientID  %>', '-1')) success = false;
                if (!kontrolEt('#' + '<%= txtCvv.ClientID  %>', '')) success = false;

                if (success) {
                    $('#' + '<%= btnKaydet.ClientID  %>').trigger("click");
                }
            });
        });
    });

    </script>



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  

    <!--ÇANTAM ÜRÜN LİSTE-->
  <div id="kredi-karti-bilgileri-kapsam">
  <div class="odeme-adimlari-kk">
      <div class="form-horizontal" role="form">
        <fieldset>
            <div class="form-group" runat="server" id="divParaPuan">
                <asp:HiddenField runat="server" ID="hidSiparisId" />
            <label class="col-sm-3 control-label"  runat="server" id="lblParaPuanHeader">Para Paun</label>
            <div class="col-sm-3">
              <asp:Label runat="server" ID="lblParaPuan" Text=""></asp:Label> 
            </div>
                <div ><asp:CheckBox runat="server" ID="cbParaPuan" Text="Kullan" OnCheckedChanged="cbParaPuan_CheckedChanged" AutoPostBack="true" /></div>
          </div>
            <div class="form-group" runat="server" id="divIndirimKodu">
            <label class="col-sm-3 control-label" for="card-holder-name"  runat="server" id="lblIndirimKoduHeader">İndirim Kodu</label>
            <div class="col-sm-3">
              <asp:TextBox runat="server" class="form-control"  ID="txtIndirimKodu" placeholder="İndirim kodu" OnTextChanged="txtIndirimKodu_TextChanged" AutoPostBack="true"/>
            </div>
          </div>
          <legend>Ödeme</legend>
          <div class="form-group">
            <label class="col-sm-3 control-label" for="expiry-month"  runat="server" id="lblOdemeTuruHeader">Ödeme Türü</label>
            <div class="col-sm-9">
              <div class="row">
                <div class="col-xs-2">
                    <asp:DropDownList ID="ddlOdemeSekli" class="form-control col-sm-2" runat="server" Width="234px">
                        <asp:ListItem Value="-1">Ödeme Türü</asp:ListItem>
                        <asp:ListItem Value="1">Tek Çekim</asp:ListItem>
                        <%--<asp:ListItem Value="2">Havale</asp:ListItem>--%>
                        <asp:ListItem Value="3">4 Taksit (Akbank)</asp:ListItem>
                        <asp:ListItem Value="4">Toptan Müşteri</asp:ListItem>
                    </asp:DropDownList>
                </div>
                
              </div>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-3 control-label" for="expiry-month"  runat="server" id="lblKartTipiHeader">Kart Tipi</label>
            <div class="col-sm-9">
              <div class="row">
                <div class="col-xs-4">
                  <asp:DropDownList ID="ddlKartTipi"  name="cardType" class="form-control col-sm-3" runat="server" >
                        <asp:ListItem Value="-1">KartTipi</asp:ListItem>
                        <asp:ListItem Value="1">Visa</asp:ListItem>
                        <asp:ListItem Value="2">Mastercard</asp:ListItem>
                    </asp:DropDownList>
                </div>               
              </div>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-3 control-label" for="card-holder-name"  runat="server" id="lblAdSoyadHeader">Ad Soyad</label>
            <div class="col-sm-3">
              <asp:TextBox runat="server" class="form-control"  ID="txtKartSahibi" placeholder="Kartın üstündeki isim"/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label" for="card-number"  runat="server" id="lblKartHeader">Kart No</label>
            <div class="col-sm-3">
              <asp:TextBox runat="server" name="pan" class="form-control" ID="txtKartNo" placeholder="Kredi kartı numaranız" maxlength="16"/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label" for="expiry-month"  runat="server" id="lblSonKullanmaHeader">Son Kullanma Tarihi</label>
            <div class="col-sm-9">
              <div class="row">
                <div class="col-xs-2">
                    <input type="hidden" name="Ecom_Payment_Card_ExpDate_Month" value="<%=aylar.SelectedItem.Text%>"/>
                    <asp:DropDownList ID="aylar" class="form-control col-sm-2" runat="server" >
                        <asp:ListItem Value="-1">Ay</asp:ListItem>
                        <asp:ListItem Value="1">Ocak</asp:ListItem>
                        <asp:ListItem Value="2">Şubat</asp:ListItem>
                        <asp:ListItem Value="3">Mart</asp:ListItem>
                        <asp:ListItem Value="4">Nisan</asp:ListItem>
                        <asp:ListItem Value="5">Mayıs</asp:ListItem>
                        <asp:ListItem Value="6">Haziran</asp:ListItem>
                        <asp:ListItem Value="7">Temmuz</asp:ListItem>
                        <asp:ListItem Value="8">Ağustos</asp:ListItem>
                        <asp:ListItem Value="9">Eylül</asp:ListItem>
                        <asp:ListItem Value="10">Ekim</asp:ListItem>
                        <asp:ListItem Value="11">Kasım</asp:ListItem>
                        <asp:ListItem Value="12">Aralık</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="col-xs-2">
                    <input type="hidden" name="Ecom_Payment_Card_ExpDate_Year" value="<%=yillar.SelectedItem.Text%>"/>
                    <asp:DropDownList ID="yillar" class="form-control" runat="server" >
                        <asp:ListItem Value="-1">Yıllar</asp:ListItem>
                        <asp:ListItem Value="2014">2014</asp:ListItem>
                        <asp:ListItem Value="2015">2015</asp:ListItem>
                        <asp:ListItem Value="2016">2016</asp:ListItem>
                        <asp:ListItem Value="2017">2017</asp:ListItem>
                        <asp:ListItem Value="2018">2018</asp:ListItem>
                        <asp:ListItem Value="2019">2019</asp:ListItem>
                        <asp:ListItem Value="2020">2020</asp:ListItem>
                        <asp:ListItem Value="2021">2021</asp:ListItem>
                        <asp:ListItem Value="2022">2022</asp:ListItem>
                        <asp:ListItem Value="2023">2023</asp:ListItem>
                    </asp:DropDownList>
                </div>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label" for="cvv" runat="server" id="lblGuvenlikHeader">Güvenlik Kodu</label>
            <div class="col-sm-3">
              <asp:TextBox runat="server" name="cv2" class="form-control" ID="txtCvv" placeholder="Kartın arkasındaki güvenlik kodu " maxlength="3"/>
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-3 col-sm-9">
              <button type="button" id="odemeYap" class="btn btn-success" value="ÖDEME YAP"></button><asp:Button ID="btnKaydet" runat="server" UseSubmitBehavior="false"  OnClick="btnKaydet_Click"  style="display:none" />
            </div>
          </div>
        </fieldset>
      </div>
      </div>
	  <div class="kredi-karti-adimi-odeme-bilgilendirme">
	  <h4 class="text-warning" runat="server" id="lblOdenecekTutarHeader">Ödenecek Tutar</h4>
	  <table>
		<tr>
              <td colspan="6" style="border-bottom:none;" >
			  <div>
                  <ul>
                    <li>
                      <label runat="server" id="lblAraToplamHeader">Ara Toplam </label>
                      <strong>:</strong> <span> <asp:Label runat="server" ID="lblToplamTutar"></asp:Label> </span></li>
                    <li>
                      <label runat="server" id="lblIndirimHeader">Toplam İndirim  Tutarı </label>
                      <strong>: </strong> <span><asp:Label runat="server" ID="lblIndirimTutari"></asp:Label></span></li>
                      <li>
                      <label runat="server" id="lblToplamTutarHeader">Toplam Tutar</label>
                      <strong>:</strong> <span><asp:Label runat="server" ID="lblOdenecekTutar"></asp:Label></span></li>
                      
					  </ul>
					  </div>
				</td>
            </tr>
	  </table>	  
	  </div>
  </div>
    
     

    <%--<input type="hidden" runat="server" id="clientid" name="clientid" value="101056567"/>
    <input type="hidden" runat="server" id="tutar" name="amount" value=""/>
    <input type="hidden" runat="server" id="referans" name="oid" value=""/>	
    <input type="hidden" runat="server" id="okSayfasi" name="okUrl" value=""/>
    <input type="hidden" runat="server" id="failSayfasi" name="failUrl" value=""/>
    <input type="hidden" runat="server" id="random" name="rnd" value="" />
    <input type="hidden" runat="server" id="hashkod" name="hash" value="" />
    <input type="hidden" runat="server" id="islemTipi" name="islemtipi" value="" />
    <input type="hidden" runat="server" id="Taksit" name="taksit" value="" />
    <input type="hidden" runat="server" id="storetype" name="storetype" value="3d_pay_hosting" />	
                                        
    <input type="hidden" runat="server" id="dil" name="lang" value=""/>
	<input type="hidden" runat="server" id="parabirimi" name="currency" value=""/>
    <input type="hidden" runat="server" id="firmaadi" name="firmaadi" value="SKALA DERİ MAMÜLLERİ İTH."/>
                                       
    <input type="hidden" runat="server" id="Fismi" name="Fismi" value=""/>
    <input type="hidden" runat="server" id="faturaFirma" name="faturaFirma" value=""/>
    <input type="hidden" runat="server" id="Fadres" name="Fadres" value=""/>
    <input type="hidden" runat="server" id="Fadres2" name="Fadres2" value=""/>
    <input type="hidden" runat="server" id="Fil" name="Fil" value=""/>
    <input type="hidden" runat="server" id="Filce" name="Filce" value=""/>
    <input type="hidden" runat="server" id="Fpostakodu" name="Fpostakodu" value=""/>
                                       
    <input type="hidden" runat="server" id="tel" name="tel" value=""/>
    <input type="hidden" runat="server" id="fulkekod" name="fulkekod" value=""/>
                                       
    <input type="hidden" runat="server" id="nakliyeFirma" name="nakliyeFirma" value=""/>
    <input type="hidden" runat="server" id="tismi" name="tismi" value=""/>
    <input type="hidden" runat="server" id="tadres" name="tadres" value=""/>
    <input type="hidden" runat="server" id="tadres2" name="tadres2" value=""/>
    <input type="hidden" runat="server" id="til" name="til" value=""/>
    <input type="hidden" runat="server" id="tilce" name="tilce" value=""/>
                                       
    <input type="hidden" runat="server" id="tpostakodu" name="tpostakodu" value=""/>
    <input type="hidden" runat="server" id="tulkekod" name="tulkekod" value=""/>
                                        
    <input type="hidden" runat="server" id="itemnumber1" name="itemnumber1" value=""/>
    <input type="hidden" runat="server" id="productcode1" name="productcode1" value=""/>
    <input type="hidden" runat="server" id="qty1" name="qty1" value=""/>
    <input type="hidden" runat="server" id="desc1" name="desc1" value=""/>
    <input type="hidden" runat="server" id="id1" name="id1" value=""/>
    <input type="hidden" runat="server" id="price1" name="price1" value=""/>
    <input type="hidden" runat="server" id="total1" name="total1" value=""/>--%>
</asp:Content>

